<script type="text/javascript">
    function onCheckClick(ckContent) {
        if (ckContent.checked)
            ckContent.value = "true";
        else
            ckContent.value = "false"
        if (ckContent.name == "ckFocusContent") {
            //var url = "<?php echo url_for("other/focus"); ?>" + "?random=" +  Math.random() + "&catalogId=1000&contentTypeId=1000";
            //var focusId = window.showModalDialog(url,null,"dialogWidth:800px;dialogHeight:400px;help:0;status:0;scroll:1;center:1;resizeable:off;");
            //if(focusId != null)
            //$("#txtHideFocusId").val(focusId);
            if (ckContent.checked)
                $("#trFocus").css("display", "block");
            else
                $("#trFocus").css("display", "none");
        }
    }

    function onSearch() {
        $("#btnSearch").attr("disabled", true);
        //alert($("#sCatalogId").val());
        var random = Math.random();
        $.ajax({url:"<?php echo url_for("celebrity/prefer");?>",data:"catalogId=" + $("#sCatalogId").val() + "&ctype=" + $("#ctype").val() + "&sex=" + $("#sex").val() + "&career=" + $("#career").val() + "&random=" + random,success: onSuccessSearch,error:onErrorSearch})
    }

    function onSuccessSearch(oMessage) {
        //alert(oMessage);
        $("#divPrefer").html(oMessage);
        $("#btnSearch").attr("disabled", false);
    }

    function onErrorSearch(x, e) {
        alert(e);
        $("#btnSearch").attr("disabled", false);
    }

    function chkpre() {
        var checkall = document.getElementsByName('precheckbox');
        content = "";
        for (var i = 0; i < checkall.length; i++) {
            if (checkall[i].checked)
                content += checkall[i].value + " ";
        }
        $("#hidpre").attr("value", content);
    }

    function checkSingleOrBand() {
        var ctype = $("input[name='ctype']:checked").val();
        switch (ctype) {
            case '1': //single
                $("#div_band").disable();
                $("#div_single").enable();
                break;
            case '2'://band
                $("#div_single").disable();
                $("#div_band").enable();
                break;
        }
    }
    $(document).ready(function() {
        checkSingleOrBand();
    });
    (function($) {
        $.fn.disable = function() {
            return $(this).find("*").each(function() {
                $(this).attr("disabled", "disabled");
            });
        }

        $.fn.enable = function() {
            return $(this).find("*").each(function() {
                $(this).removeAttr("disabled");
            });
        }
    })(jQuery);
</script>

<body>
<div>
<form id="form1" name="form1" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
    <td class="newsTd">明星百科：</td>
    <td align="right" style="padding-right:300px"><input name="btnBack" type="button" value="取 消"
                                                         onclick="history.go(-1);"/></td>
</tr>
<tr>
    <td class="newsTd">栏目：</td>
    <td>
        <?php
                @include_component("other", "catalog", array("selectedId" => $sf_request->getParameter("catalogId")));
        ?></td>
</tr>
<tr>
    <td class="newsTd">文档属性：</td>
    <td>推荐
        <input type="checkbox" id="ckRecommendContent" name="ckRecommendContent" value="1"/>
        &nbsp;&nbsp;&nbsp;
        置顶
        <input type="checkbox" id="ckTop" name="ckTop" value="1"/>
        &nbsp;</td>
</tr>
<tr>
    <!--    <td class="newsTd">文档属性：</td>-->
    <td class="newsTd">类别：</td>
    <td>单人
        <input type="radio" value="1" name="ctype" checked="true" onchange="checkSingleOrBand()"/>
        &nbsp;&nbsp;&nbsp;
        组合
        <input type="radio" value="2" name="ctype" onchange="checkSingleOrBand()"/>
        &nbsp;</td>

</tr>
<tr>
    <td class="newsTd">分类字母</td>
    <td><input name="capital_letter" id="capital_letter" type="text" size="3"/></td>
</tr>
<tr>
    <td class="newsTd"><b>单人：</b></td>
    <td>
        <div id="div_single">
            <table id="tb_single" width="90%" border="1" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="newsTd">姓名：</td>
                    <td>
                        <input name="name" type="text" size="10"/>
                        昵称：
                        <input name="stage_name" type="text" size="10"/>
                        <!--                        外文名：-->
                        <!--                        <input name="foreign_name" type="text" size="10"/>-->
                        外文名：
                        <input name="english_name" type="text" size="10"/>
                        性别：
                        <select name="sex" id="sex">
                            <option value="male">男</option>
                            <option value="female">女</option>
                            <!--            <option value="mixed">组合</option>-->
                        </select>
                        出生年月日：
                        <input name="birthday" id="birthday" type="text" size="14" value="2010-12-12"/>
                        星座：
                        <input name="horoscope" type="text" size="4"/></td>
                </tr>
                <tr>
                    <td class="newsTd">血型：</td>
                    <td>
                        <input name="blood_type" type="text" size="10"/>
                        国籍：
                        <input name="country" type="text"/>
                        所属公司：<input name="company_name" type="text"/>
                        所属组合：<input name="belong_band" type="text"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">身高：</td>
                    <td>
                        <input name="heights" type="text" size="10"/>
                        体重：
                        <input name="weights" type="text" size="6"/>
                        出道日期：
                        <input name="work_date" type="text" value="2010-12-12"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">毕业学校：</td>
                    <td>
                        <input name="school" type="text" size="26"/>

                    </td>
                </tr>
                <tr>
                    <td class="newsTd">职&nbsp;&nbsp;&nbsp;&nbsp;业：</td>
                    <td>
                        <select name="career" id="career">
                            <option value="actor">演员</option>
                            <option value="singer">歌手</option>
                            <!--                        <option value="group">组合</option>-->
                        </select>
                        圈内好友：
                        <input name="friends" type="text" size="40"/>
                    </td>


                </tr>
                <tr>
                    <td class="newsTd">居住地：</td>
                    <td>
                        <input name="locations" type="text" size="35"/>
                        来源：
                        <input name="source" type="text" size="35"/></td>
                </tr>

            </table>
        </div>
    </td>
</tr>
<tr>
    <td>

    </td>
    <td> &nbsp;</td>
</tr>
<tr>
    <td class="newsTd"><b>组合：</b></td>
    <td>
        <div id="div_band">
            <table id='tb_band' width="90%" border="1" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="newsTd">组合名：</td>
                    <td>
                        <input name="band_name" type="text" size="35"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">组合成员：</td>
                    <td>
                        <input name="band_member" type="text" size="35"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">出道日期：</td>
                    <td>
                        <input name="band_work_date" type="text" size="35"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">所属公司：</td>
                    <td>
                        <input name="band_company_name" type="text" size="35"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">代表色：</td>
                    <td>
                        <input name="band_color" type="text" size="35"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">应援口号：</td>
                    <td>
                        <input name="band_slogan" type="text" size="35"/>
                    </td>
                </tr>
                <tr>
                    <td class="newsTd">应援物：</td>
                    <td>
                        <input name="band_mascot" type="text" size="35"/>
                    </td>
                </tr>


            </table>
        </div>
    </td>
</tr>
<tr>
    <td class="newsTd">官方歌迷名称：</td>
    <td>
        <input name="fans_name" type="text" size="35"/>
    </td>
</tr>
<tr>
    <td class="newsTd">TAG标签：</td>
    <td rowspan="2">
        <table width="90%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td height="25px"><input name="tag" type="text" size="45"/></td>
                <td width="671" rowspan="2">多个关键字和TAG标签，请以“，”分隔</td>
            </tr>
            <tr>
                <td height="25px"><input type="text" name="keyword" size="45"/></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td class="newsTd">关键字：</td>
</tr>
<tr>
    <td class="newsTd">照片：</td>
    <td>
        <input type="text" id="Txt0" name="Txt0" value=""/>
        <input name="button24" type="button" onclick="getFileUrlFromCKFinder('Txt0','Img0')" value="浏览"/></td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td>
        <table width="90%" height="53" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td><br><img id="Img0" width="247" height="316" alt="247*316"/></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td class="newsTd">小头像：</td>
    <td>
        <input type="text" id="small_txt" name="small_txt" value=""/>
        <input name="button24" type="button" onclick="getFileUrlFromCKFinder('small_txt','small_img')" value="浏览"/>
    </td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td>
        <table width="90%" height="53" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td><br>
                    <img id="small_img" width="126" height="126"
                         alt="126X126"/></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td class="newsTd"><br/>
        简介：
    </td>
    <td class="newsTd">&nbsp;</td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td><textarea name="brief" cols="80" rows="8"></textarea>
    </td>
</tr>
<tr>
    <td colspan="3"><br/>
        <table width="100%" cellSpacing="0" border="0">
            <tr>
                <td width="40%">网址1</td>
                <td rowspan="4" align="left"><img id="Img1" name="Img1" src="" width="88" height="66" alt="88X66"/></td>
            </tr>
            <tr>
                <td>网址快照：

                    <input type="text" id="Txt1" name="Txt1" value=""/>
                    <input name="button23" type="button" onclick="getFileUrlFromCKFinder('Txt1','Img1')" value="浏览"/>
                </td>
            </tr>
            <tr>
                <td><p>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：
                    <input type="text" name="title1"/>
                    <br/>
                </p></td>
            </tr>
            <tr>
                <td><p>网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：
                    <input name="website1" type="text" size="50"/>
                    <br/>
                </p></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td colspan="3"><br/>
        <table width="100%" cellSpacing="0" border="0">
            <tr>
                <td width="40%">网址2</td>
                <td rowspan="4" align="left"><img id="Img2" src="" width="88" height="66" alt="88X66"/></td>
            </tr>
            <tr>
                <td>网址快照：

                    <input type="text" id="Txt2" name="Txt2" value=""/>
                    <input name="button22" type="button" onclick="getFileUrlFromCKFinder('Txt2','Img2')" value="浏览"/>
                </td>
            </tr>
            <tr>
                <td><p>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：
                    <input type="text" name="title2"/>
                    <br/>
                </p></td>
            </tr>
            <tr>
                <td><p>网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：
                    <input name="website2" type="text" size="50"/>
                    <br/>
                </p></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td colspan="3"><br/>
        <table width="100%" cellSpacing="0" border="0">
            <tr>
                <td width="40%">网址3</td>
                <td rowspan="4" align="left"><img id="Img3" src="" width="88" height="66" alt="88X66"/></td>
            </tr>
            <tr>
                <td>网址快照：
                    <input type="text" id="Txt3" name="Txt3" value=""/>
                    <input name="button25" type="button" onclick="getFileUrlFromCKFinder('Txt3','Img3')" value="浏览"/>
                </td>
            </tr>
            <tr>
                <td><p>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：
                    <input type="text" name="title3"/>
                    <br/>
                </p></td>
            </tr>
            <tr>
                <td><p>网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：
                    <input name="website3" type="text" size="50"/>
                    <br/>
                </p></td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td colspan="3"><br/>
        <table width="60%" cellSpacing="0" border="0">
            <tr>
                <td>你会喜欢：
                    <input type="hidden" id="hidpre" name="hidpre"/>
                    <input type="button" id="btnSearch" onclick="onSearch();" name="btnSearch" value="搜索"/>
                </td>
            </tr>
            <tr>
                <td><br>

                    <div class="tab">
                        <div class="lists" id="divPrefer">
                        </div>
                    </div>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td class="newsTd"><br/>
        是否审核：
    </td>
    <td><br/>
        <input type="radio" name="check" value="true" disabled=""/>
        是&nbsp;&nbsp;&nbsp;
        <input type="radio" name="check" value="false" disabled="" checked="checked"/>
        否&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        发布时间：
        <input type="text" name="nowtime" id="nowtime" value="<?php echo date("Y-m-d H:i:s");?>"/>
        &nbsp;&nbsp;
        <input name="button2" type="button" onclick="$('#nowtime').val(getCurrentDateTimeStr());" value="设为当前时间"/>
    </td>
</tr>
<tr>
    <td colspan="2">点&nbsp;&nbsp;击&nbsp;&nbsp;率：0
        &nbsp;&nbsp;&nbsp;点击调整：
        <input name="hitMark" type="text" size="10" value="0"/>
    </td>
</tr>
<tr>
    <td align="center" colspan="2" style="height:50px;"><input type="hidden" name="celebrityEdit" id="celebrityEdit"
                                                               value="1"/>
        <input name="btnAdd" type="submit" id="btnAdd" value="添 加" onclick="chkpre();"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
                name="btnBack" type="button" value="取 消" onclick="history.go(-1);"/><input name="btnPublish"
                                                                                           type="submit" id="btnPublish"
                                                                                           value="发 布"
                                                                                           onclick="chkpre();"
                                                                                           style="display:none;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </td>
</tr>
</table>
</form>
</div>
<?php use_helper("dates"); ?>

